<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>Essential Links</h2>
  </div>
</template>

<script>
import axios from 'axios';
import qs from 'qs'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  methods:{
    test(){
      //http://tp.cn/point
      axios.get('http://tp.cn/point')
        .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
          console.log(error);
      });
    },
    post(){
      let data = {
        firstName: 'Fred',
        lastName: 'Flintstone'
      };
      axios.post('http://tp.cn/point',data)
      .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
          console.log(error);
      });
    },
    put(){
      let data = {
        firstName: 'Fred',
        lastName: 'Flintstone'
      };
      axios.put('http://tp.cn/point/sdddd',data)
      .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
          console.log(error);
      });
    },
    delete(){
      let data = {
        firstName: 'Fred',
        lastName: 'Flintstone'
      };
      axios.delete('http://tp.cn/point/sdddd',data)
      .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
          console.log(error);
      });
    },
  },
  mounted(){
    // this.test();
    // this.post();
    // this.put();
    this.delete();
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
